<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<script src="http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script>
</head>
<body style="background:url('assets/images/extract.jpg') no-repeat;">
	<table align="center" style="margin-top:100px">
		<tr>
			<td><%=request.getParameter("name")%>给您分享了加密文件</td>
		</tr>
		<tr>
			<td colspan="2">请输入提取码：</td>
		</tr>
		<tr>
			<td><input type="text" id="extract" style="width:200px;height:39px" /></td>
			<td><input type="image" onclick="extract()" src="assets/images/extract.png" /></td>
		</tr>
		<tr>
			<td colspan="2"><span id="error" style="color:red"></span>
			<td>
		</tr>
	</table>
	<script type="text/javascript">
function extract() {
	var ecode=$("#extract").val();
	var id='<%=request.getParameter("id")%>';
			if (ecode != "") {
				$.post('${pageContext.request.contextPath}/cloud/extract.do', {
					id : id,
					ecode : ecode,
				}, function(data) {
					if (data == "error") {
						$("#error").html("提取码错误!");
					} else {
						window.location.href = data;
					}
				});
				$("#extract").val("");
				$("#error").html("");
			} else {
				$("#error").html("提取码不能为空!");
			}
		}
	</script>
</body>
</html>
